﻿using Application.Website.ActionFilter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Application.Website.Controllers
{
    public class AdminController : ApplicationController
    {
        private static AuthenticationService _authentication = new AuthenticationService();

        #region Authentication

        public ActionResult Login()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Login(string userName, string password)
        {
            //if (_authentication.AuthenticateStaff(userName, password))
            //{
            //    string _url = "/";
            //    if (Request["returnUrl"] != null)
            //        _url = Request["returnUrl"].ToString();
            //    _url = "/admin" + _url.Replace("/admin", "");
            //    return Redirect(_url);
            //}
            return View();
        }

        public ActionResult LogOut()
        {
            _authentication.SignOut();
            return RedirectToAction("Login");
        }

        #endregion

        #region Authorization

        [HttpGet]
        public ActionResult AddUser()
        {
            return View();
        }

        #endregion

        //[AdminAuthorize]
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Dashboard()
        {
            return View();
        }
    }
}
